package com.solace.selenium.service.impl;

import com.solace.selenium.service.WebDriverService;
import com.solace.selenium.utils.XpathUrl;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

@Service
public class WebDriverServiceImpl implements WebDriverService {
    @Autowired
   private FirefoxDriver firefoxDriver;
    @Override
    public void soldOut(String goodsId) {
        /*WebElement table = firefoxDriver.findElement(By.className("ant-table-tbody"));
        List<WebElement> trs = table.findElements(By.tagName("tr"));
        for (WebElement tr : trs) {
            List<WebElement> tds = tr.findElements(By.tagName("td"));
            for (WebElement td : tds) {
                String text = td.getText();
                if (goodsId.equals(text)){
                    tr.findElement(By.xpath("//a[contains(text(),'删除')]")).click();
                    //firefoxDriver.navigate().refresh();
                }
            }
        }*/
        goodsShelves(goodsId);
    }

    @Override
    public void getUrl(String url) {
        Assert.hasText(url,"跳转链接不能为空");
        firefoxDriver.get(url);
    }

    @Override
    public void shelves(String goodsId) {
        /*Assert.hasText(goodsId, "添加的商品ID不能为空");
        *//*firefoxDriver.get(URL.goosList);
        WebDriverWait wait = new WebDriverWait(firefoxDriver, 60);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//th[contains(text(),'商品序号')]")));*//*
        //点击添加商品
        firefoxDriver.findElement(By.xpath("//span[contains(text(),'添加商品')]")).click();
        WebDriverWait addGoods = new WebDriverWait(firefoxDriver, 60);
        addGoods.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//table/tbody/*[@class='ant-table-row ant-table-row-level-0']/..")));
        //选中表单
        WebElement table = firefoxDriver.findElement(By.xpath("//table/tbody/*[@class='ant-table-row ant-table-row-level-0']/.."));
        List<WebElement> trs = table.findElements(By.tagName("tr"));
        for (WebElement tr : trs) {
            List<WebElement> tds = tr.findElements(By.tagName("td"));
            for (WebElement td : tds) {
                String text = td.getText();
                if (goodsId.equals(text)) {
                    tds.get(0).click();
                }
            }
        }
        WebElement element = firefoxDriver.findElement(By.xpath("//button[@class='ant-btn submit ant-btn-primary']"));
        *//*Actions actions = new Actions(firefoxDriver);
        actions.moveToElement(element).click(element).build().perform();*//*
        element.click();*/
        goodsPrimary(goodsId);
        addGoodsDetermine(goodsId);
    }

    @Override
    public void goodsNumber(String goodsId, String number) {
        Assert.hasText(goodsId,"商品ID不能为空");
        Assert.hasText(number,"商品数量不能为空");
        String xpath = "//td[text()='" + goodsId + "']/..";
            WebDriverWait opsClickGoods = new WebDriverWait(firefoxDriver, 30);
        opsClickGoods.until(ExpectedConditions.elementToBeClickable(By.xpath(xpath + "//input[@class='ant-input']")));
        WebElement element = firefoxDriver.findElement(By.xpath(xpath + "//input[@class='ant-input']"));
        element.clear();
        element.sendKeys(number);
        WebDriverWait suffix = new WebDriverWait(firefoxDriver, 30);
        suffix.until(ExpectedConditions.elementToBeClickable(By.xpath(xpath+"//span[@class='ant-input-suffix']")));
        firefoxDriver.findElement(By.xpath(xpath+"//span[@class='ant-input-suffix']")).click();
    }

    @Override
    public void commentator(String goodsId) {
        Assert.hasText(goodsId,"商品ID不能为空");
        String xpath = "//td[text()='" + goodsId + "']/..//a[text()='讲解']";
        WebElement table = firefoxDriver.findElement(By.xpath(xpath));
        table.click();
    }

    @Override
    public void notCommentator(String goodsId) {
        Assert.hasText(goodsId,"商品ID不能为空");
        String xpath = "//td[text()='" + goodsId + "']/..//a[text()='取消讲解']";
        WebElement table = firefoxDriver.findElement(By.xpath(xpath));
        table.click();
    }

    @Override
    public void goodsPrimary(String goodsId) {
        Assert.hasText(goodsId,"商品ID不能为空");
        //点击添加商品
        firefoxDriver.findElement(By.xpath(XpathUrl.ADDGOODSBUTTON)).click();
        //添加商品查找
        firefoxDriver.findElement(By.xpath(XpathUrl.ADDGOODSFIND)).sendKeys(goodsId);
        //点击查找
        firefoxDriver.findElement(By.xpath(XpathUrl.FINDGOODSBUTTON)).click();

    }

    @Override
    public void addGoodsDetermine(String goodsId) {
        //选中商品
        String choseGoods = XpathUrl.CHOOSEGOODS;
        choseGoods=choseGoods.replaceAll("GOODSID", goodsId);
        WebDriverWait ops = new WebDriverWait(firefoxDriver, 30);
        ops.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(choseGoods)));
        firefoxDriver.findElement(By.xpath(choseGoods)).click();
        WebDriverWait opsClickGoods = new WebDriverWait(firefoxDriver, 30);
        opsClickGoods.until(ExpectedConditions.elementToBeClickable(By.xpath(XpathUrl.CLICKGOODS)));
        firefoxDriver.findElement(By.xpath(XpathUrl.CLICKGOODS)).click();
    }

    @Override
    public void goodsShelves(String goodsId) {
        Assert.hasText(goodsId,"商品ID不能为空");
        String goodsXpath = XpathUrl.GOODSSHELVES;
        goodsXpath=goodsXpath.replaceAll("GOODSID", goodsId);
        firefoxDriver.findElement(By.xpath(goodsXpath)).click();
    }

    @Override
    public void addLocalStorage() {
        //firefoxDriver.get("https://buyin.jinritemai.com/dashboard/live/list");
        JavascriptExecutor js = ( JavascriptExecutor ) firefoxDriver;
        String title = (String) js.executeScript("localStorage.setItem('__tea_cache_tokens_4031','{\"web_id\":\"6996312800893126185\",\"ssid\":\"b57d4665-8dfa-4438-9e9d-1202779ff04e\",\"user_unique_id\":\"6996312800893126185\",\"timestamp\":1628956018311}')," +
                "localStorage.setItem('HAS_SHOW_MERCH_PICKING_HALL_TUTORIAL','true')," +
                "localStorage.setItem('LOCAL_MENU_TREE_3469885008196598477','{\"menu_list\":[{\"name\":\"直播管理\",\"icon\":\"\",\"url\":\"\",\"children\":[{\"name\":\"直播管理\",\"icon\":\"live-broadcast-management\",\"url\":\"\",\"children\":[{\"name\":\"直播中控台\",\"icon\":\"\",\"url\":\"/live/control\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"直播实时数据\",\"url\":\"/livedata/visual\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]},{\"name\":\"直播间发券\",\"icon\":\"\",\"url\":\"/marketing/live-provide\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"is_external_sub_app\":\"true\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"直播商品管理\",\"icon\":\"\",\"url\":\"/live/list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"直播闪购\",\"icon\":\"\",\"url\":\"/jade/list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"脚本预审\",\"icon\":\"\",\"url\":\"/regulation/script-check\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"直播设置\",\"icon\":\"\",\"url\":\"/live/setting\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600025\",\"second_menu_id\":\"live-broadcast-management\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"橱窗管理\",\"icon\":\"window-management\",\"url\":\"\",\"children\":[{\"name\":\"橱窗商品管理\",\"icon\":\"\",\"url\":\"/shopwindow/goods-list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600025\",\"second_menu_id\":\"window-management\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"巨量千川\",\"icon\":\"ad-tool\",\"url\":\"\",\"children\":[{\"name\":\"直播推广\",\"icon\":\"\",\"url\":\"/qianchuan\",\"children\":null,\"extra\":{\"account_type\":\"\",\"is_link\":\"true\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600025\",\"second_menu_id\":\"ad-tool\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"营销管理\",\"icon\":\"marketing-management\",\"url\":\"\",\"children\":[{\"name\":\"主播券管理\",\"icon\":\"\",\"url\":\"/marketing/coupon-manager\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"is_external_sub_app\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"创券资金明细\",\"url\":\"/marketing/financial-detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"is_external_sub_app\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\",\\\"删除配置项\\\":\\\"delete\\\"}\"}]},{\"name\":\"红包管理\",\"icon\":\"\",\"url\":\"/marketing/red-envelope\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"is_external_sub_app\":\"true\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600025\",\"second_menu_id\":\"marketing-management\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"违规管理\",\"icon\":\"regulation-penalty\",\"url\":\"\",\"children\":[{\"name\":\"帐号违规管理\",\"icon\":\"\",\"url\":\"/regulation/penalty\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600025\",\"second_menu_id\":\"regulation-penalty\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"false\",\"first_menu_id\":\"liveManagement\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"精选联盟\",\"icon\":\"\",\"url\":\"\",\"children\":[{\"name\":\"选品广场\",\"icon\":\"alliance-shop\",\"url\":\"\",\"children\":[{\"name\":\"选品广场\",\"icon\":\"\",\"url\":\"/merch-picking-hall\",\"children\":null,\"extra\":{\"account_type\":\"\",\"hot_tag\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"选品广场决策页\",\"url\":\"/merch-picking-hall/merch_promoting\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"选品广场专题页\",\"url\":\"/merch-picking-hall/picking-pool\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"选品广场画像页\",\"url\":\"/merch-picking-hall/portraits\",\"extra\":\"{\\\"account_type\\\":0,\\\"delete\\\":\\\"delete\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"选品广场类目选择页\",\"url\":\"/merch-picking-hall/category-select\",\"extra\":\"{\\\"account_type\\\":0,\\\"delete\\\":\\\"delete\\\",\\\"shop_category\\\":\\\"\\\",\\\"删除配置项\\\":\\\"delete\\\"}\"},{\"name\":\"选品广场\",\"url\":\"/merch-picking-hall/center\",\"extra\":\"{\\\"account_type\\\":0,\\\"delete\\\":\\\"delete\\\",\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"hot_tag\":\"false\",\"not_render_in_menu\":\"\",\"parent_navigate\":\"600138\",\"second_menu_id\":\"alliance-shop\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"撮合活动\",\"icon\":\"platform-activity\",\"url\":\"\",\"children\":[{\"name\":\"抖Link大会\",\"icon\":\"\",\"url\":\"/douLink/list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"抖Link报名信息\",\"url\":\"/douLink/info\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"抖Link会场\",\"url\":\"/douLink/detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"商家主页\",\"url\":\"/darenActivity/shop-detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"达人主页\",\"url\":\"/servicehall/daren-profile\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"机构主页\",\"url\":\"/institution/homepage\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600138\",\"second_menu_id\":\"platform-activity\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"排行榜\",\"icon\":\"buyin-hot-list\",\"url\":\"\",\"children\":[{\"name\":\"达人排行榜\",\"icon\":\"\",\"url\":\"/ranklist/daren\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"达人服务机构榜\",\"icon\":\"\",\"url\":\"/ranklist/inst-daren\",\"children\":null,\"extra\":{\"account_type\":\"\",\"second_menu_id\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"商家服务机构榜\",\"icon\":\"\",\"url\":\"/ranklist/inst-merchant\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600138\",\"second_menu_id\":\"buyin-hot-list\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"带货设置\",\"icon\":\"sale-settings\",\"url\":\"\",\"children\":[{\"name\":\"带货任务设置\",\"icon\":\"\",\"url\":\"/taskcenter/task-setting\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"主页设置\",\"icon\":\"\",\"url\":\"/accountmanager/service-mall\",\"children\":null,\"extra\":{\"account_type\":\"\",\"new_mark\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"达人主页\",\"url\":\"/servicehall/daren-profile\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"}]},{\"name\":\"联系方式\",\"icon\":\"\",\"url\":\"/daren/contact\",\"children\":null,\"extra\":{\"account_type\":\"\",\"new_mark\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"达人飞书绑定\",\"url\":\"/daren/contact/lark\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600138\",\"second_menu_id\":\"sale-settings\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"false\",\"first_menu_id\":\"allianceShop\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"数据参谋\",\"icon\":\"\",\"url\":\"\",\"children\":[{\"name\":\"数据参谋\",\"icon\":\"data-advice\",\"url\":\"\",\"children\":[{\"name\":\"直播数据\",\"icon\":\"\",\"url\":\"/livedata/index\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"直播带货数据详情\",\"url\":\"/livedata/detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]},{\"name\":\"成交详情\",\"icon\":\"\",\"url\":\"/dataCenter/detail\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600147\",\"second_menu_id\":\"data-advice\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"订单管理\",\"icon\":\"order-management\",\"url\":\"\",\"children\":[{\"name\":\"联盟订单明细\",\"icon\":\"\",\"url\":\"/dataCenter/order\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"数据导出\",\"url\":\"/export\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"结算退款订单记录\",\"url\":\"/dataCenter/refundOrder\",\"extra\":\"{\\\"account_type\\\":0,\\\"menu_user_white_list\\\":\\\"58157694652,101245197859,826456268343598\\\",\\\"shop_category\\\":\\\"\\\"}\"}]},{\"name\":\"导出记录\",\"icon\":\"\",\"url\":\"/dataCenter/export-list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"new_mark\":\"true\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600147\",\"second_menu_id\":\"order-management\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"账单管理\",\"icon\":\"bill-management\",\"url\":\"\",\"children\":[{\"name\":\"佣金分成账单\",\"icon\":\"\",\"url\":\"/pay/settlement-record\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"资产总览\",\"icon\":\"\",\"url\":\"/pay/balance\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"is_external_sub_app\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"动帐明细\",\"url\":\"/pay/account-flow\",\"extra\":\"{\\\"account_type\\\":0,\\\"delete\\\":\\\"delete\\\",\\\"is_external_sub_app\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"提现记录\",\"url\":\"/pay/withdrawal-record\",\"extra\":\"{\\\"account_type\\\":0,\\\"delete\\\":\\\"delete\\\",\\\"is_external_sub_app\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600147\",\"second_menu_id\":\"bill-management\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"电商罗盘\",\"icon\":\"aweme-ecom-compass\",\"url\":\"https://compass.jinritemai.com/business_api/home/buyin_redirect/10100\",\"children\":null,\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"is_link\":\"true\",\"parent_navigate\":\"600147\",\"second_menu_id\":\"dataAdviser_daren\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"false\",\"first_menu_id\":\"dataAdviser_daren\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"平台活动\",\"icon\":\"\",\"url\":\"\",\"children\":[{\"name\":\"直播间活动\",\"icon\":\"daren-activity\",\"url\":\"\",\"children\":[{\"name\":\"直播间报名\",\"icon\":\"\",\"url\":\"/marketing/live-apply\",\"children\":null,\"extra\":{\"account_type\":\"\",\"delete\":\"delete\",\"is_external_sub_app\":\"true\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"活动详情\",\"url\":\"/marketing/live-apply-detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"is_external_sub_app\\\":\\\"true\\\",\\\"menu_user_white_list\\\":\\\"delete\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"商家主页\",\"url\":\"/darenActivity/shop-detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"达人主页\",\"url\":\"/servicehall/daren-profile\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"},{\"name\":\"活动详情\",\"url\":\"/darenActivity/activity-detail\",\"extra\":\"{\\\"account_type\\\":0,\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600215\",\"second_menu_id\":\"daren-activity\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"false\",\"first_menu_id\":\"activityCenter\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"基础设置\",\"icon\":\"\",\"url\":\"\",\"children\":[{\"name\":\"基础设置\",\"icon\":\"basic-settings\",\"url\":\"\",\"children\":[{\"name\":\"合同管理\",\"icon\":\"\",\"url\":\"/contractManage/contract-list\",\"children\":null,\"extra\":{\"account_type\":\"\",\"shop_category\":\"\"},\"sub_pages\":[{\"name\":\"资质认证\",\"url\":\"/contractManage/contract-sign\",\"extra\":\"{\\\"account_type\\\":0,\\\"not_render_in_menu\\\":\\\"true\\\",\\\"shop_category\\\":\\\"\\\"}\"}]}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600156\",\"second_menu_id\":\"basic-settings\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"星图管理\",\"icon\":\"xingtu-management\",\"url\":\"\",\"children\":[{\"name\":\"帐号绑定\",\"icon\":\"\",\"url\":\"/accountmanager/daren-xingtu-binding\",\"children\":null,\"extra\":{\"account_type\":\"\",\"expand\":\"\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"true\",\"parent_navigate\":\"600156\",\"second_menu_id\":\"xingtu-management\",\"shop_category\":\"\"},\"sub_pages\":null}],\"extra\":{\"account_type\":\"\",\"expand\":\"false\",\"first_menu_id\":\"basicSettings_daren\",\"shop_category\":\"\"},\"sub_pages\":null},{\"name\":\"抖音电商学习中心\",\"icon\":\"\",\"url\":\"https://school.jinritemai.com/buyin/web\",\"children\":null,\"extra\":{\"account_type\":\"\",\"first_menu_id\":\"ecomSchool\",\"is_link\":\"true\",\"shop_category\":\"\"},\"sub_pages\":null}],\"date\":1628956133465}')," +
                "localStorage.setItem('tt_scid','TnnfbcprGO3mN7ylJ-zFIbw7mF9dM2POlxewdQrebMZh0jOeA0eetBrmjMUvFl1n9597')," +
                "localStorage.setItem('LIVE_ITEM_SELL_POINT_GUIDE','LIVE_ITEM_SELL_POINT_GUIDE')," +
                "localStorage.setItem('HAS_SHOW_DAREN_DATA_ORDER','true')," +
                "localStorage.setItem('__garfishPreloadApp__','[{\"appName\":\"daren\",\"count\":3}]')," +
                "localStorage.setItem('__tea_sdk_ab_version_2631','{\"ab_version\":[],\"ab_ext_version\":[],\"ab_version_multilink\":[],\"data\":{},\"timestamp\":1628956133417}')," +
                "localStorage.setItem('_byted_param_sw','OIISoQUbYeSIVlxFiik=')," +
                "localStorage.setItem('showHotTagTimeStamp','1631548018180')," +
                "localStorage.setItem('__tea_cache_first_2631','1')," +
                "localStorage.setItem('HAS_SHOW_TASK_SETTING','true')," +
                "localStorage.setItem('LIVE_GOOD_GUIDE','LIVE_GOOD_GUIDE')," +
                "localStorage.setItem('__tea_cache_tokens_2631','{\"web_id\":\"6996312789217084931\",\"ssid\":\"bf8359d3-9e17-41cd-8b1c-886d8fe54d4d\",\"user_unique_id\":\"3469885008196598477\",\"timestamp\":1628956017806}')," +
                "localStorage.setItem('HAS_SHOW_ANCHOR_COUPON','true')," +
                "localStorage.setItem('=^_^=athena_web_id','4d6f0071-3903-4f60-8e59-a7daf740e586')," +
                "localStorage.setItem('HAS_SHOW_QC_TUTORIAL','true')," +
                "localStorage.setItem('showNewV2TimeStamp','1629560818180')," +
                "localStorage.setItem('LIVE_GOOD_SHOW_FLAG_V2','LIVE_GOOD_SHOW_FLAG_V2')," +
                "localStorage.setItem('CLOSED_MESSAGE_IDS','3497930507381926648')," +
                "localStorage.setItem('HAS_SHOW_ALL_MENU_TUTORIALS','true')," +
                "localStorage.setItem('__tea_cache_first_4031','1')," +
                "localStorage.setItem('HAS_SHOW_DAREN_HOMEPAGE','true')," +
                "localStorage.setItem('HAS_SHOW_DOULINK_ORDER','true')");
        firefoxDriver.navigate().refresh();
    }
}
